<template>
    <van-nav-bar title="主页" left-text="返回" left-arrow @click-left="() => { router.back('/login') }" fixed />
      <div style="margin-top: 40px;"></div>
        <van-search v-model="value" shape="round"  placeholder="请输入搜索关键词"  @click="sousuo"/> 
     <lunb></lunb>
   <!-- 宫格   -->
 <van-grid :column-num="4">
  <van-grid-item v-for="item in navData" :key="value" :icon="item.image_src" :text="item.name" />
</van-grid>
  <!-- 楼层 -->
  <div v-for="item in lcData">
       <img style="width: 100%;" :src="item.floor_title.image_src" alt="">
     <div v-for="items in item.product_list" style="float: left;">
          <img style="width: 100px; height: 120px;" :src="items.image_src" alt="">
     </div>    
  </div>
</template>

<script setup>
import { ref } from 'vue';
import lunb from '@/components/lunb.vue';
import {navApi} from '@/api/api'
const navData=ref([])
navApi().then(res=>{
    console.log('宫格',res)
  navData.value=res.data.message
})

import {lcApi} from '@/api/api'
const lcData=ref([])
lcApi().then(res=>{
    console.log('楼层',res)
  lcData.value=res.data.message
})

import { useRouter } from 'vue-router';
let router=new useRouter
const sousuo=()=>{
   router.push('/sousuo')
}
</script>

<style lang="scss" scoped></style>